/*    */ package com.zimbra.cs.service.admin;
/*    */ 
/*    */ import com.zimbra.common.service.ServiceException;
/*    */ import com.zimbra.common.soap.AdminConstants;
/*    */ import com.zimbra.common.soap.Element;
/*    */ import com.zimbra.common.util.AccountLogger;
/*    */ import com.zimbra.common.util.Log.Level;
/*    */ import com.zimbra.common.util.LogFactory;
/*    */ import com.zimbra.cs.account.Account;
/*    */ import com.zimbra.cs.account.Provisioning;
/*    */ import com.zimbra.cs.account.Server;
/*    */ import com.zimbra.cs.account.accesscontrol.AdminRight;
/*    */ import com.zimbra.cs.account.accesscontrol.Rights.Admin;
/*    */ import com.zimbra.soap.ZimbraSoapContext;
/*    */ import java.util.List;
/*    */ import java.util.Map;
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ public class GetAccountLoggers
/*    */   extends AdminDocumentHandler
/*    */ {
/*    */   public Element handle(Element request, Map<String, Object> context)
/*    */     throws ServiceException
/*    */   {
/* 38 */     ZimbraSoapContext zsc = getZimbraSoapContext(context);
/*    */     
/* 40 */     Server localServer = Provisioning.getInstance().getLocalServer();
/* 41 */     checkRight(zsc, context, localServer, Rights.Admin.R_manageAccountLogger);
/*    */     
/*    */ 
/* 44 */     Account account = AddAccountLogger.getAccountFromLoggerRequest(request);
/*    */     
/* 46 */     Element response = zsc.createElement(AdminConstants.GET_ACCOUNT_LOGGERS_RESPONSE);
/* 47 */     for (AccountLogger al : LogFactory.getAllAccountLoggers()) {
/* 48 */       if (al.getAccountName().equals(account.getName())) {
/* 49 */         Element eLogger = response.addElement("logger");
/* 50 */         eLogger.addAttribute("category", al.getCategory());
/* 51 */         eLogger.addAttribute("level", al.getLevel().toString());
/*    */       }
/*    */     }
/*    */     
/* 55 */     return response;
/*    */   }
/*    */   
/*    */   public void docRights(List<AdminRight> relatedRights, List<String> notes)
/*    */   {
/* 60 */     relatedRights.add(Rights.Admin.R_manageAccountLogger);
/*    */   }
/*    */ }


/* Location:              /home/mint/zimbrastore.jar!/com/zimbra/cs/service/admin/GetAccountLoggers.class
 * Java compiler version: 7 (51.0)
 * JD-Core Version:       0.7.1
 */